From c22b0ab804432a4f9004f7d779a44f37ad751e17 Mon Sep 17 00:00:00 2001
From: "mwilli2@equilibrium.research"
Date: Tue, 2 Nov 2004 01:26:40 +0000
Subject: [PATCH] bitkeeper revision 1.1159.1.329
(4186e250v4q4bACc3tLT1SAh95SQxw)
A coven of new wizards for Xensv (please test). Some of this might
need refactoring but it should make the web interface more useful.
also: misc version updates, some extra docs stuff.
---
.rootkeys | 3 ++
docs/src/user.tex | 38 ++++++++++-----
tools/examples/xmexample1 | 2 +-
tools/examples/xmexample2 | 2 +-
tools/python/xen/sv/CreateDomain.py | 5 +-
tools/python/xen/sv/Main.py | 18 +++++--
tools/python/xen/sv/MigrateDomain.py | 72 ++++++++++++++++++++++++++++
tools/python/xen/sv/RestoreDomain.py | 46 ++++++++++++++++++
tools/python/xen/sv/SaveDomain.py | 59 +++++++++++++++++++++++
9 files changed, 225 insertions(+), 20 deletions(-)
create mode 100644 tools/python/xen/sv/MigrateDomain.py
create mode 100644 tools/python/xen/sv/RestoreDomain.py
create mode 100644 tools/python/xen/sv/SaveDomain.py
diff --git a/.rootkeys b/.rootkeys
index 9dd3e38f59..cc0e349319 100644
--- a/.rootkeys
+++ b/.rootkeys
@@ -423,7 +423,10 @@
40fcefb23FfQn-ZBCbcHqA0cPGqQxw tools/python/xen/sv/GenTabbed.py
40fcefb2QZAn3u3sX-M7NXBjOv5HGg tools/python/xen/sv/HTMLBase.py
40fcefb2vnfDbl4w_yCTedROPuqs0g tools/python/xen/sv/Main.py
+4186e24fZMp7_bX4f50MvUscdrST9Q tools/python/xen/sv/MigrateDomain.py
40fcefb24h-04WaHag-Tg4nxWPhTig tools/python/xen/sv/NodeInfo.py
+4186e24fb4YtJw155tNtSXXN6nEWqA tools/python/xen/sv/RestoreDomain.py
+4186e24fVXt0lfeQSAy1eiFKnPCHTg tools/python/xen/sv/SaveDomain.py
40fcefb2Sif__6AqrANeBQZZfvP-6w tools/python/xen/sv/TabView.py
41052eb8UrgtUkuJPg7oY1tutVQHsg tools/python/xen/sv/Wizard.py
40fcefb2DqteqCCZYDCvvh4Q5jBd0w tools/python/xen/sv/__init__.py
diff --git a/docs/src/user.tex b/docs/src/user.tex
index 299683e248..2db3ffbe5c 100644
--- a/docs/src/user.tex
+++ b/docs/src/user.tex
@@ -314,7 +314,7 @@ complicated. The makefile needs a `pristine' Linux kernel tree to which
it will then add the Xen architecture files. You can tell the
makefile the location of the appropriate Linux compressed tar file by
setting the LINUX\_SRC environment variable, e.g. \\
-\verb!# LINUX_SRC=/tmp/linux-2.6.8.1.tar.bz2 make world! \\ or by
+\verb!# LINUX_SRC=/tmp/linux-2.6.9.tar.bz2 make world! \\ or by
placing the tar file somewhere in the search path of {\tt
LINUX\_SRC\_PATH} which defaults to `{\tt .:..}'. If the makefile
can't find a suitable kernel tar file it attempts to download it from
@@ -342,7 +342,7 @@ argument to make to get a parallel build.
If you have an existing Linux kernel configuration that you would like
to use for domain 0, you should copy it to
-install/boot/config-2.6.8.1-xen0. During the first build, you may be
+install/boot/config-2.6.9-xen0. During the first build, you may be
asked about some Xen-specific options. We advise accepting the
defaults for these options.
@@ -364,8 +364,8 @@ destinations.
Files in \path{install/boot/} include:
\begin{itemize}
\item \path{install/boot/xen.gz} The Xen 'kernel'
-\item \path{install/boot/vmlinuz-2.6.8.1-xen0} Domain 0 XenLinux kernel
-\item \path{install/boot/vmlinuz-2.6.8.1-xenU} Unprivileged XenLinux kernel
+\item \path{install/boot/vmlinuz-2.6.9-xen0} Domain 0 XenLinux kernel
+\item \path{install/boot/vmlinuz-2.6.9-xenU} Unprivileged XenLinux kernel
\end{itemize}
The difference between the two Linux kernels that are built is due to
@@ -379,7 +379,7 @@ domains.
The \path{install/boot} directory will also contain the config files
used for building the XenLinux kernels, and also versions of Xen and
XenLinux kernels that contain debug symbols (\path{xen-syms} and
-\path{vmlinux-syms-2.6.8.1-xen0}) which are essential for interpreting crash
+\path{vmlinux-syms-2.6.9-xen0}) which are essential for interpreting crash
dumps. Retain these files as the developers may wish to see them if
you post on the mailing list.
@@ -393,9 +393,9 @@ This file is sometimes called \path{menu.lst}, depending on your
distribution. The entry should look something like the following:
\begin{verbatim}
-title Xen 2.0 / XenLinux 2.6.8.1
+title Xen 2.0 / XenLinux 2.6.9
kernel /boot/xen.gz dom0_mem=131072 com1=115200,8n1
- module /boot/vmlinuz-2.6.8.1-xen0 root=/dev/sda4 ro console=tty0 console=ttyS0
+ module /boot/vmlinuz-2.6.9-xen0 root=/dev/sda4 ro console=tty0 console=ttyS0
\end{verbatim}
The first line of the configuration (kernel...) tells GRUB where to
@@ -575,7 +575,7 @@ basics.
\item Download the ttylinux disk image from XXX where from?
\item Create a configuration file like the following:
\begin{verbatim}
-kernel = "/boot/vmlinuz-2.6.8.1-xenU" # or a 2.4 kernel or a xen0 kernel
+kernel = "/boot/vmlinuz-2.6.9-xenU" # or a 2.4 kernel or a xen0 kernel
memory = 64
name = "ttylinux"
cpu = -1 # leave to Xen to pick
@@ -905,9 +905,11 @@ docs to do advanced stuff.
\chapter{Domain Configuration Files}
\label{cha:config}
-XXX Could use a little explanation about possible values
+XX Could use a little explanation about possible values
-Xen configuration files contain the following standard variables:
+Xen configuration files contain the following standard variables.
+Unless otherwise stated, configuration items should be enclosed in
+quotes (i.e. {\tt '...'} or {\tt ``....''})):
\begin{description}
\item[kernel] Path to the kernel image (on the server).
@@ -916,8 +918,20 @@ Xen configuration files contain the following standard variables:
\item[memory] Memory size in megabytes.
\item[cpu] CPU to assign this domain to.
\item[nics] Number of virtual network interfaces.
-\item[vif] List of MAC addresses (random addresses are assigned if not given).
-\item[disk] Regions of disk to export to the domain.
+\item[vif] List of MAC addresses (random addresses are assigned if not given) and /
+ or bridges to use for the domains network interfaces. e.g. \\
+ \verb_vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0', 'bridge=xen-br1' ]_
+ to assign a MAC address and bridge to the first interface and assign a
+ different bridge to the second interface, leaving Xend to choose the MAC
+ address.
+\item[disk] List of block devices to export to the domain. e.g. \\
+ \verb_disk = [ 'phy:hda1,sda1,r' ]_ \\
+ exports device \path{/dev/hda1} to the domain, as \path{/dev/sda1} with
+ readonly access being allowed. \\
+ \verb_disk = [ 'phy:hda7,sda2,w', 'phy:hdb2,sda,w!' ]_ \\
+ exports device \path{/dev/hda7} to the domain as \path{/dev/sda2} with
+ write access enabled and \path{/dev/hdb2} as \path{/dev/sda} with write access
+ force enabled (bypassing safety checks).
\item[dhcp] Set to {\tt 'dhcp'} if you want to DHCP allocate the IP address.
\item[netmask] IP netmask.
\item[gateway] IP address for the gateway (if any).
diff --git a/tools/examples/xmexample1 b/tools/examples/xmexample1
index e9c7315a3b..cdf4b6c824 100644
--- a/tools/examples/xmexample1
+++ b/tools/examples/xmexample1
@@ -8,7 +8,7 @@
#----------------------------------------------------------------------------
# Kernel image file.
-kernel = "/boot/vmlinuz-2.6.8.1-xenU"
+kernel = "/boot/vmlinuz-2.6.9-xenU"
# Optional ramdisk.
#ramdisk = "/boot/initrd.gz"
diff --git a/tools/examples/xmexample2 b/tools/examples/xmexample2
index c7c5d3b54f..61479ca5f0 100644
--- a/tools/examples/xmexample2
+++ b/tools/examples/xmexample2
@@ -36,7 +36,7 @@ xm_vars.check()
#----------------------------------------------------------------------------
# Kernel image file.
-kernel = "/boot/vmlinuz-2.6.8.1-xenU"
+kernel = "/boot/vmlinuz-2.6.9-xenU"
# Optional ramdisk.
#ramdisk = "/boot/initrd.gz"
diff --git a/tools/python/xen/sv/CreateDomain.py b/tools/python/xen/sv/CreateDomain.py
index ebacf9eb74..4378897e5c 100644
--- a/tools/python/xen/sv/CreateDomain.py
+++ b/tools/python/xen/sv/CreateDomain.py
@@ -16,7 +16,7 @@ class CreateDomain( Wizard ):
CreatePage4,
CreateFinish ]
- Wizard.__init__( self, urlWriter, "Create Domain Wizard", sheets )
+ Wizard.__init__( self, urlWriter, "Create Domain", sheets )
class CreatePage0( Sheet ):
@@ -31,7 +31,8 @@ class CreatePage1( Sheet ):
def __init__( self, urlWriter ):
Sheet.__init__( self, urlWriter, "Setup Kernel Image", 1 )
- self.addControl( ListControl( 'builder', [('linux', 'Linux'), ('netbsd', 'NetBSD')], 'Kernel Type:' ) )
+# For now we don't need to select a builder...
+# self.addControl( ListControl( 'builder', [('linux', 'Linux'), ('netbsd', 'NetBSD')], 'Kernel Type:' ) )
self.addControl( FileControl( 'kernel', '/boot/vmlinuz-2.6.9-xenU', 'Kernel Image:' ) )
self.addControl( InputControl( 'extra', '', 'Kernel Command Line Parameters:' ) )
diff --git a/tools/python/xen/sv/Main.py b/tools/python/xen/sv/Main.py
index 402c24a511..196e1c1450 100755
--- a/tools/python/xen/sv/Main.py
+++ b/tools/python/xen/sv/Main.py
@@ -3,6 +3,9 @@ from xen.sv.DomList import DomList
from xen.sv.NodeInfo import NodeInfo
from xen.sv.DomInfo import DomInfo
from xen.sv.CreateDomain import CreateDomain
+from xen.sv.MigrateDomain import MigrateDomain
+from xen.sv.SaveDomain import SaveDomain
+from xen.sv.RestoreDomain import RestoreDomain
from xen.xend.XendClient import server
@@ -16,7 +19,14 @@ class Main( HTMLBase ):
self.modules = { "node": NodeInfo,
"list": DomList,
"info": DomInfo,
- "create": CreateDomain }
+ "create": CreateDomain,
+ "migrate" : MigrateDomain,
+ "save" : SaveDomain,
+ "restore" : RestoreDomain }
+
+ # ordered list of module menus to display
+ self.module_menus = [ "node", "create", "migrate", "save",
+ "restore", "list" ]
HTMLBase.__init__(self)
def render_POST( self, request ):
@@ -53,10 +63,10 @@ class Main( HTMLBase ):
request.write( " " )
request.write( "